Linux CentOS7

Fucking firewall

查看版本

firewall-cmd --version

查看状态

firewall-cmd --state

查看所有打开的端口

firewall-cmd --zone=public --list-ports

添加端口(需要重载)

firewall-cmd --zone=public --add-port=6379/tcp --permanent (需要重载)

重新载入,更新防火墙规则

firewall-cmd --reload

Python3 & pip3

环境:
	操作系统:centos7

安装环境依赖

yum install epel-release -y
yum install gcc zlib zlib-devel libffi libffi-devel readline-devel openssl-devel openssl11 openssl11-devel -y

下载 python3.11.5 源代码,也可以下载后上传到 centos7

wget https://www.python.org/ftp/python/3.11.5/Python-3.11.5.tgz

解压到当前目录下

tar -xf Python-3.11.5.tgz

进入解压出的 python3.11.5 目录

cd ./Python-3.11.5

生成 make 文件,--prefix 指定 python3.11.5 的安装目录为 /usr/python

./configure --prefix=/usr/python

编译文件

make clean
make && make install

建立软连接

ln -s /usr/python/bin/python3 /usr/bin/python3
ln -s /usr/python/bin/pip3 /usr/bin/pip3

测试 python3 & pip3

python3 -V
pip3 -V